package com.lyan.myapplication.http;

import com.lyan.myapplication.bean.BaseBean;
import com.lyan.myapplication.bean.User;

import java.util.Map;

import io.reactivex.Observable;
import retrofit2.Call;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

/**
 * Created by Administrator on 2017/3/30.
 */

public interface HttpInterface {


    /**
     * 获取验证码
     * @param phoneNumber
     * @return
     */
    @POST("courier/token/captcha")
    Observable<BaseBean> getVerificationCode(@Query("loginName") String phoneNumber);


    /**
     * 密码登录
     * @return
     */
    @POST("courier/account/token/login")
    Observable<BaseBean<User>> login(@QueryMap Map<String, Object> params);


    /**
     * 验证手机号码
     * @param loginName
     * @param captcha
     * @return
     */
    @POST("courier/account/token/captcha/check")
    Observable<BaseBean> checkPhone(@Query("loginName") String loginName, @Query("captcha") String captcha);


    /**
     * 注册
     * @param params
     * @return
     */
    @POST("courier/account/token/register")
    Observable<BaseBean<User>> register(@QueryMap Map<String, Object> params);

    /**
     * 设置/重置密码
     * @param params
     * @return
     */
    @POST("courier/account/token/resetpassword")
    Observable<BaseBean> resetPassword(@QueryMap Map<String, Object> params);

}
